import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import { analysisURL } from './utils/common'

import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
if (!(window as any).__POWERED_BY_QIANKUN__) {
  const hash = window.location.hash.split('?')[1] || ''
  // console.log(' hash => :', hash)
  if (hash) {
    // const token = (window as any).localStorage.getItem('storage-base-user-info') && JSON.parse((window as any).localStorage.getItem('storage-base-user-info')).token
    const url_data = analysisURL(hash)
    const isToken = Object.keys(url_data).includes('token')
    console.log(url_data,'url_data')
    // const _token = hash.split('=')[1]
    if (isToken) window.localStorage.setItem('storage-base-user-info', JSON.stringify(url_data))
  }
}
const app = createApp(App);
 
app.use(router).use(ElementPlus);
 
app.mount('#app');